package com.qiuhui.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName: UserController
 * @Description: TODO
 * @author: tian
 * @date: 2021/3/22  2:09 下午
 */
// 加上注解@RequestMapping，访问地址为http://localhost:8080/Info/user
@RequestMapping("/Info")
@Controller
public class UserController {
    @RequestMapping("/user")
    public String userInfo(Model model) {
        //向模型中添加属性msg与值，可以在JSP页面中取出并渲染
        model.addAttribute("msg", "use database.");
        return "user";
    }
}
